package com.ruoyi.gateway.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author liuyj
 * @since 2021/5/17 13:50
 */
@RestController
public class HealthController {
    private final static Logger logger = LoggerFactory.getLogger(HealthController.class);

    @GetMapping("/ping")
    public String getPing(){
        logger.info("gateway ping");
        return "gateway pong";
    }

    @GetMapping("/getHead")
    public String getRequest(HttpServletRequest request){
        String head = request.getHeader("X-Access-Token");
        return "结果:" + head;

    }
}
